package cn.hls.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.codehaus.jackson.annotate.JsonIgnore;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import com.chinamobile.openmas.client.Sms;

/**
 * @fileName: AdviceMsg.java
 * @package: cn.hls.entity 　*@Description: 证件过期通知实体类 
 * 　*@author: yinghui.zhang
*@email: uuhui@163.com
 * @date: 2016年11月13日
 * 
 */
@Table(name = "t_sms_advice")
@Entity
@DynamicInsert
@DynamicUpdate
public class SmsAdvice extends BaseEntity {
	private static final long serialVersionUID = 1778700424169854637L;
	private Integer type;// 短信提示类型 1-企业相关证件过期 2-车辆证件过期 3-员工证件过期
	private Long sourceId;// 通知对象的编号
	private String sourceCode;// 通知对象的代码
	private String sendName;// 短信通知对象名称
	private String sendPhone;// 短信通知对象手机
	private Integer status;// 短信通知状态
	private String content;// 短信通知内容
	private Integer dateDiff;// 时间差

	public SmsAdvice() {

	}

	public SmsAdvice(Integer type, Long sourceId, String sourceCode,
			Integer dateDiff) {
		this.type = type;
		this.sourceId = sourceId;
		this.sourceCode = sourceCode;
		this.dateDiff = dateDiff;
	}

	public SmsAdvice(Integer type, Long sourceId, String sourceCode,
			String sendName, String sendPhone, String content, Integer status) {
		this.type = type;
		this.sourceId = sourceId;
		this.sourceCode = sourceCode;
		this.sendName = sendName;
		this.sendPhone = sendPhone;
		this.content = content;
		this.status = status;
	}

	@Column(name = "type")
	public Integer getType() {
		return type;
	}

	public void setType(Integer type) {
		this.type = type;
	}

	@Column(name = "source_code", length = 16)
	public String getSourceCode() {
		return sourceCode;
	}

	public void setSourceCode(String sourceCode) {
		this.sourceCode = sourceCode;
	}

	@Column(name = "source_id")
	public Long getSourceId() {
		return sourceId;
	}

	public void setSourceId(Long sourceId) {
		this.sourceId = sourceId;
	}

	@Column(name = "send_name", length = 32)
	public String getSendName() {
		return sendName;
	}

	public void setSendName(String sendName) {
		this.sendName = sendName;
	}

	@Column(name = "send_phone", length = 16)
	public String getSendPhone() {
		return sendPhone;
	}

	public void setSendPhone(String sendPhone) {
		this.sendPhone = sendPhone;
	}

	@Column(name = "status")
	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	@Column(name = "content", length = 255)
	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	@Transient
	@JsonIgnore
	public Integer getDateDiff() {
		return dateDiff;
	}

	public void setDateDiff(Integer dateDiff) {
		this.dateDiff = dateDiff;
	}

	public static void main(String[] args) throws Exception {
		
		Sms sms = new Sms("http://nb067.openmas.net:9080/OpenMasService");
        String[] destinationAddresses = new String[]{"13486486219"};
        String message="短信测试";
        String extendCode = "3"; //自定义扩展代码（模块）
        String ApplicationID= "8002001";
        String Password = "KbeTpeSZWpuF";

        //发送短信
      String GateWayid = sms.SendMessage(destinationAddresses, message, extendCode, ApplicationID, Password);
        System.out.println(GateWayid);

		


	}
}